<template>
    <div style="display: flex;flex-direction: column">
        <el-input class="input" placeholder="模版ID"></el-input>
        <el-input class="input" v-model="templateName" placeholder="模版名称"></el-input>
        <el-input class="input" v-model="tradeId" placeholder="模版类型"></el-input>
        <div>
            <el-button @click="addOrModifyTemplate">
                确定
            </el-button>
            <el-button @click="$emit('close')">
                取消
            </el-button>
        </div>
    </div>
</template>

<script>
    import request from '../request'
    export default {
        name: "AddOrModifyTemplate",
        data: function () {
            return {
                visible: true,
                templateName:'',
                tradeId:''
            }
        },
        create(){

        },
        beforeUpdate(){
          console.log("测试")
        },
        props: {
            info: Object,
        },
        computed:{
            templateId:function(){
                console.log("ssss")
                return this.info.templateId
            }
        },
        methods:{
            addOrModifyTemplate(){
                console.log(this.info)
                request.post('template/addOrUpdateTemplate')
              setTimeout(()=>{
                  alert("上传成功")
                  this.$emit('close')
              },1000)
            }
        }
    }
</script>

<style scoped>
    .input {
        margin: 10px;
    }
</style>
